package com.zxw.java基础.引用传递;

import com.zxw.java基础.引用传递.参数.User;

/**
 * @projectName: util-cloud
 * @package: com.zxw.java基础.引用传递
 * @className: Test
 * @author: zhangxuewei
 * @description: TODO
 * @date: 2023/9/23 14:13
 * @version: 1.0
 */
public class Test {

    public User first(){
        User user = new User("张学伟");
        return user;
    }

    public User second(User user){
        User secondUser = new User("张学伟2");
        secondUser = user;
        secondUser.setName("张峻霖");
        return secondUser;
    }

    public static void main(String[] args) {
        Test test = new Test();
        User firstUs = test.first();
        User secondUs = test.second(firstUs);
        System.out.println(firstUs== secondUs);
        System.out.println(firstUs);
        System.out.println(secondUs);

    }
}
